<template>
    <div class="bg">
        <el-row :gutter="20">
            <el-form
              :model="contractDetailHeaderData"
              label-width="130px"
            >
                <el-col :span="24">
                    <el-col :span="8">
                        <el-form-item label="考核名称：">
                            <el-tooltip class="item" effect="dark" :content="contractDetailHeaderData.contractName" placement="top-start">
                                 <el-tag class="tagName">{{contractDetailHeaderData.contractName}}</el-tag>
                            </el-tooltip>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="受约人姓名：">
                            {{contractDetailHeaderData.shouyueName}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="受约人职务：">
                            <span v-for="(item,index) in cutout(contractDetailHeaderData.shouyueZhiwu)" :key="index">{{ item }}</span>
                        </el-form-item>
                    </el-col>
                </el-col>
                <el-col :span="24">
                    <el-col :span="8">
                        <el-form-item label="合同有效期：">
                            <span v-if="contractDetailHeaderData.htYxqq&&contractDetailHeaderData.htYxqz">{{ contractDetailHeaderData.htYxqq}}<span style="margin: 0 20px;">至</span>{{ contractDetailHeaderData.htYxqz }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="发约人姓名：">
                            {{contractDetailHeaderData.fayueName}}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="合同状态：">
                            <el-tag type="danger">{{cutout2(contractDetailHeaderData.contractAuditStatus)}}</el-tag>
                        </el-form-item>
                    </el-col>
                </el-col>
            </el-form>
        </el-row>
    </div>
</template>
<script>
export default {
    props:{
        contractDetailHeaderData:{},
    },
    data:{
        return:{

        }
    },
    methods:{
      cutout(cellValue) {
      if (cellValue) {
        var c = cellValue.split(",");
        if(c.size<1){
          c.push('-');
          c.push('-');
        } else if(c.size<2){
          c.push('-');
        }
        return c;
      }
    },
        cutout2(cellValue) {
            if (cellValue == 0) {
                return "创建中";
            }
            if (cellValue == 1) {
                return "指标填报中";
            }
            if (cellValue == 2) {
                return "汇总中";
            }
            if (cellValue == 3) {
                return "汇总完成";
            }
            if (cellValue == 4) {
                return "文本审核中";
            }
            if (cellValue == 5) {
                return "文本审核退回";
            }
            if (cellValue == 6) {
                return "文本审核通过";
            }
            if (cellValue == 7) {
                return "受约人审核中";
            }
            if (cellValue == 67) {
                return "受约人驳回";
            }
            if (cellValue == 78) {
                return "绩效考核办公室审核中";
            }
            if (cellValue == 8) {
                return "发约人审核中";
            }
            if (cellValue == 9) {
                return "签订完成";
            }
            if (cellValue == 10) {
                return "履约中";
            }
            if (cellValue == 11) {
                return "结果填报中";
            }
            if (cellValue == 111) {
                return "填报审核驳回";
            }
            if (cellValue == 12) {
                return "结果填报审核中";
            }
            if (cellValue == 13) {
                return "结果汇总完成";
            }
            if (cellValue == 14) {
                return "领导审核中";
            }
            if (cellValue == 15) {
                return "领导审核完成";
            }
            if (cellValue == 16) {
                return "已结束";
            }
        },
    },
}
</script>
<style>
.bg{
    background: #fff;
    box-shadow: 5px 5px 5px #AAAAAA;
    padding: 10px;
    border-radius: 13px;
}
.tagName{
    text-overflow: ellipsis;
    width: 100%;
    overflow:hidden;
    margin: 5px 0;
}
</style>